Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test plugin and rdmo setup #2

Closed
wants to merge 1 commit into from

Conversation

afuetterer
Copy link
Member

@afuetterer afuetterer commented Jul 23, 2024

@MyPyDavid: This is a redo of #1.

I looked at what you wanted to achieve and tried to put it in the ci.yml.

The workflow pulls the plugin repo and gets only the testing directory from the rdmo repository.

This leads to a "working testing setup", as you can see in the two dummy tests. I test that the plugin settings from local.py are correctly loaded into the django project settings. Also I verify the fixtures get loaded into the database.

This only works in CI though, if you run pytest locally, the rdmo testing directory is not present.

But the setup in #1 only worked in ci as well?

What do you think? Is this the way to go?

@afuetterer afuetterer marked this pull request as draft July 23, 2024 07:18
key: lint-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run linters via pre-commit (ruff, eslint)
run: pre-commit run --all-files --color=always
uses: rdmorganiser/.github/.github/workflows/_lint.yml@main
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal to use the job from the central .github repo.

- run: python -m pip list
- run: pytest -s

# dev-setup:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncommented for now to save some time when working on this PR.

@@ -0,0 +1,9 @@
# ruff: noqa: F821
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sufficient?

Do we need to put rdmo-plugins-radar into INSTALLED_APPS?

@@ -0,0 +1,39 @@
from pathlib import Path
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied these fixtures from the rdmo repo. We can of course pull this file from the rdmo during ci.
But I guess we need to have additional fixtures here.

@@ -0,0 +1,20 @@
import pytest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are only dummy tests.

@afuetterer
Copy link
Member Author

Maybe we could also go this way, and move all testing related stuff, like fixtures and testing config to a new repository, that you could just clone or pip install during testing in all projects?

Like https://github.com/scikit-hep/scikit-hep-testdata/

@jochenklar
Copy link
Member

In principle, I like the idea, but the tests in RDMO are written with those concrete fixtures in mind, and will only work with those. Other projects do that differently.

@afuetterer
Copy link
Member Author

By other projects I meant the rdmo-plugins. Your argument still applies?

The plugins need some test data as well or why are we doing this setup here?

@afuetterer afuetterer closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants